{KeyVault} Support quoted object id for set-policy and delete-policy#13146
{KeyVault} Support quoted object id for set-policy and delete-policy#13146
object id for set-policy and delete-policy#13146Conversation
| attrs = ['object_id', 'spn', 'upn'] | ||
| for attr in attrs: | ||
| if getattr(ns, attr): | ||
| setattr(ns, attr, getattr(ns, attr).strip('"')) |
There was a problem hiding this comment.
for upn, is it safe to strip " ? what's the name convention? suggest only change object_id for now.
There was a problem hiding this comment.
for upn, is it safe to strip
"? what's the name convention? suggest only change object_id for now.
Most of UPN names are email-like: https://docs.microsoft.com/en-us/azure/active-directory/hybrid/plan-connect-userprincipalname
As far as I know there is also a type of UPN for external users like this: bim_microsoft.com#EXT#@AzureSDKTeam.onmicrosoft.com
Both formats don't have leading or tailing quotes.
But in case that there are maybe some unknown formats may have quotes, I will keep the original format for UPN and SPN. Will investigate them again when we have new user ask.
object id, spn, upn for set-policy and delete-policyobject id for set-policy and delete-policy
|
Key Vault |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
While the change LGTM, this is a very common usage in other commands as well, we may need to further consider fixing it in the core. Probably remove quotes in |
Graceful solution. As this is not urgent, I will change the implementation in the same PR later. |
|
Using |
|
@bim-msft please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Support for #11950
The case is when user try to obtain the object id using the following command (-o json):
The ID will be quoted like this:
This quoted ID cannot be passed into the command:
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.